package com.mew.league.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mew.league.service.IMessageService;
import com.mew.common.dc.mapper.MemberMapper;
import com.mew.common.dc.mapper.MessageMapper;
import com.mew.common.entity.league.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ztq
 * @since 2021-03-25
 */
@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements IMessageService {

    @Autowired
    private MemberMapper memberMapper;

    public void sendMessage(long uid,long toUserId,int type,Integer gift,Long gold){
        Message message = Message.builder().userId(uid).toUserId(toUserId).type(type).gift(gift).gold(gold).build();
        save(message);

        //提示推送
        if (toUserId==0){
            //推所有人
            //new LambdaQueryWrapper<Member>().eq(Member::getLeagueId,u)
            //leagueMapper.
        }

    }
}
